import { HTTP } from '../utils/http.js';
import { mineModule } from './mine.js'

const Mine = new mineModule()

import util from '../utils/util.js';



export class workModule extends HTTP {
	getWorkTypeData(index, tpye) {
		const userData = util.getStorage('userData')
		return this.request({
			url: '/api/Gtasks/GetGtasks',
			data: {
				userID: userData.userID,
				gtaState: tpye,
				currentPage: index,
				currentNumber: 10
			}
		})
	}

	getDetailsData(rouID, rouType, gtaID) {
		const userData = util.getStorage('userData')
		return this.request({
			url: '/api/Gtasks/GetGtasksDetails',
			data: {
				userID: userData.userID,
				rouID,
				rouType,
				gtaID
			}
		})
	}
	
	completeTask(rouID, rouType, gtaID) {
		return this.request({
			url: '/api/TaskAssignments/AchieveTask',
			data: {
				rouID,
				rouType,
				gtaID
			}
		})
	}
	
	getEmployeeList(empID) {
		return this.request({
			url: '/api/TaskAssignments/GetEmployeeList',
			data: {
				empID
			}
		})
	}
	postAssignTask(data) {
		let {rouID,rouType,gtaID,empID} = data
		const userData = util.getStorage('userData')
		return this.request({
			url: '/api/TaskAssignments/AssignTask',
			data:{
				userID: userData.userID,
				rouID,
				rouType,
				gtaID,
				empID
			}
		})
	}
	
}
